<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>VueJs指令：v-on：mouseenter</title>
  <style>
    #divbox{transition: 1s;}
  </style>
</head>
<body>
<div id="app">
  <div id="divbox" @mouseenter="enter" @mouseleave="outer">我是以div,鼠标移动进来会可以效果哦</div>
</div>
<script src="js/vue.min.js"></script>
<script>
  var vue = new Vue({
    el:"#app",
    data:{
    },
    methods:{
      enter:function(){
        console.log(1);
        document.getElementById("divbox").style.background = "red";
        document.getElementById("divbox").style.color = "#fff";
        document.getElementById("divbox").style.fontSize = "24px";
      },
      outer:function(){
        console.log(2);
        document.getElementById("divbox").style.background = "green";
        document.getElementById("divbox").style.color = "#fff";
        document.getElementById("divbox").style.fontSize = "14px";
      }
    }
  })
</script>
</body>
</html>